package j2025.j04;

import javax.swing.tree.TreeNode;

/**
 * @Author 猫大仙
 */
public class j0401 {
    TreeNode r = null;
    public void flatten(TreeNode root) {
        if(root == null) return;
        flatten(root.right);
        flatten(root.left);
        root.left = null;
        root.right = r;
        r = root;
    }

}
